<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    ul{
      display: flex;
      list-style-type: none;
      flex-wrap: wrap;
    }
    li{
      width: 25%;
      display: flex;
      flex-direction: column;
      align-items: center;
      
    }
    h2{
      font-size: 16px;
    }
    li img{
      width: 80%;
    }
  </style>
</head>
<body>
  <div id="app">
    <ul>
      <li v-for="item in items" :key="item.id">
        <h4>
          {{ item.name }}
        </h4>
        <img :src="item.pic" alt="">
      </li>
    </ul>
  </div>
  <script src="./vue.js"></script>
  <script src="./axios.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data:{
        items: []
      },
      created() {
        this.fetchItems()
      },
      methods: {
        fetchItems(){
          axios.post('https://api.it120.cc/conner/shop/goods/list',{
            categoryId: 72399
          }).then(res=>{
            if(res.data.code === 0){
              console.log(res)
              this.items = res.data.data;
            }
          })
        }
      }
    })
  </script>
</body>
</html>